Skip to content

feat(notifications): customizable comment-notification recipients#94

Merged
yumike merged 1 commit into
mainfrom
feat/customizable-comment-recipients
Jun 30, 2026
Merged

feat(notifications): customizable comment-notification recipients#94
yumike merged 1 commit into
mainfrom
feat/customizable-comment-recipients

Conversation

@yumike

@yumike yumike commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

What

Adds a code extension seam so a company can replace who is notified about doc comments (e.g. notify a maintainers user-list instead of all members of the owning group), with today's behavior preserved as the default.

How

  • CommentRecipientResolverresolveRecipients(activity) => Promise<string[]> ([] = notify nobody; no null sentinel).
  • rwCommentRecipientExtensionPoint — a module-owned extension point with a single setRecipientResolver (throws on double-registration), mirroring Backstage's own setNotificationRecipientResolver. A sibling pluginId: "rw" module registers a resolver; the notifications module reads it in its own init (the framework orders the sibling first).
  • DefaultCommentRecipientResolver (exported) — the prior policy (new thread → section owner; reply/resolve → participants). Custom resolvers delegate to it for audiences they don't override.
  • CommentNotifier delegates recipient selection to the resolver and is fail-closed: if a resolver throws, the notification is discarded and logged rather than falling back to the broader default audience. Coalescing scope and topic stay tied to the activity kind, not the recipients.
  • Re-documents CommentActivity.sectionOwnerRef as a neutral fact (rw-node, doc-only).
  • README: a "Customizing who gets notified" section with a worked maintainers example + install-order precondition.

Notes

  • Behavior is unchanged for existing installs (no resolver registered → built-in default).
  • Recipients-only seam: scope/topic/formatting/actor-exclusion are untouched.
  • 27 tests (incl. startTestBackend integration tests proving the override and double-register-throws); typecheck/lint/format clean across all workspaces.

🤖 Generated with Claude Code

Add a code extension seam so a company can replace who is notified about doc
comments (e.g. a maintainers user-list instead of all members of the owning
group), with today's behavior preserved as the default.

- CommentRecipientResolver interface: resolveRecipients(activity) => string[]
  ([] = notify nobody; no null sentinel).
- rwCommentRecipientExtensionPoint: module-owned extension point with a single
  setRecipientResolver (throws on double-registration), mirroring Backstage's
  own setNotificationRecipientResolver. A sibling pluginId:"rw" module registers
  a resolver; the notifications module reads it in its own init.
- DefaultCommentRecipientResolver (exported): the prior policy (new thread =>
  section owner; reply/resolve => participants); custom resolvers delegate to it
  for audiences they don't override.
- CommentNotifier delegates recipient selection to the resolver and is
  fail-closed: if the resolver throws, the notification is discarded and logged
  rather than falling back to the broader default audience. Coalescing scope and
  topic stay tied to the activity kind, not the recipients.
- Re-document CommentActivity.sectionOwnerRef as a neutral fact (rw-node).
- README: 'Customizing who gets notified' section with a worked example.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@yumike yumike merged commit 29f9d6a into main Jun 30, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant